﻿@model IQReportes.ViewModels.UsuarioBasicoViewModel
@using IQReportes.ViewModels
@{
    ViewBag.Title = "Edit";
}
<div id="UsuarioEditar" class="container form form-horizontal">
    
    @using (Html.BeginForm("Editar","Usuario")) {
    @Html.ValidationSummary(true)
        <fieldset>
            @Html.HiddenFor(model=>model.id)
            @Html.HiddenFor(model=>model.txBotonDateSeleccion)
            @Html.HiddenFor(model=>model.txInstitucion)
            @Html.HiddenFor(model=>model.pcInstitucion)
            <legend>Editar</legend>
            <div class="control-group">
                <label class="control-label">@Html.LabelFor(model=>model._usuario)</label>
                <div class="controls">
                    @if ( Model._usuario.CompareTo("Administrador")==0){
                        @Html.TextBoxFor(model => model._usuario,new { disabled = "disabled" });
                        @Html.HiddenFor(model=>model._usuario)
                    }
                    else{
                        @Html.EditorFor(model => model._usuario);
                        @Html.ValidationMessageFor(model => model._usuario)
                    }
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">@Html.LabelFor(model=>model.claveEdit)</label>
                <div class="controls">
                    @Html.HiddenFor(model=>model.clave  )
                    @Html.PasswordFor(model=>model.claveEdit)
                    @Html.ValidationMessageFor(model => model.claveEdit)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">@Html.LabelFor(model => model.nombre)</label>
                <div class="controls">
                    @Html.EditorFor(model =>model.nombre)
                    @Html.ValidationMessageFor(model => model.nombre)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">@Html.LabelFor(model=>model.email)</label>
                <div class="controls">
                    @Html.EditorFor(model =>model.email)
                    @Html.ValidationMessageFor(model => model.email)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">@Html.LabelFor(model=>model.idPerfil)</label>
                <div class="controls">
                    @if ( Model._usuario.CompareTo("Administrador")==0 ){
                        @Html.HiddenFor(model=>model.idPerfil)
                        @Html.TextBoxFor(model => model.nombrePerfil,new { disabled = "disabled" });
                    }
                    else{
                        @Html.DropDownList("idPerfil")
                    }
                </div>
            </div>
            <div class="form-actions">
                <a href="@Url.Action("Index")" class="btn">Regresar</a>
			    <input type="submit" class="btn btn-primary" value="Guardar"/>
	        </div>
        </fieldset>
    }
    <script src="~/Scripts/ValidacionesBootstrap.js"></script>
</div>